package com.rayo.accesscontrollercopy.app;

import android.app.Application;

import com.facebook.stetho.Stetho;
import com.facebook.stetho.okhttp3.StethoInterceptor;
import com.github.johnkil.print.PrintConfig;
import com.litesuits.android.log.Log;
import com.rayo.accesscontrollercopy.config.Version;
import com.rayo.accesscontrollercopy.model.db.DbHelp;
import com.rayo.keyholder.serialport.KeyHolderPort;

import okhttp3.OkHttpClient;

/**
 * Created by yanghaojie on 16/7/11.
 */
public class App extends Application {
    @Override
    public void onCreate() {
//        boolean isInSamplerProcess = BlockCanaryEx.isInSamplerProcess(this);
//        if(!isInSamplerProcess) {
//            BlockCanaryEx.install(new Config(this));
//        }
        super.onCreate();
        KeyHolderPort.getmInstance().setPort("dev/ttyS3");
//        if(!isInSamplerProcess) {
//            //your code start here
//        }
        Log.isPrint = Version.isPrint;
//        CrashHandler.getInstance().init(getApplicationContext());
        PrintConfig.initDefault(getAssets(), "fonts/iconfont.ttf");
        Stetho.initializeWithDefaults(this);
        new OkHttpClient.Builder()
                .addNetworkInterceptor(new StethoInterceptor())
                .build();
        DbHelp.CreateDb(this);
    }
}
